/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.com.fastfood4.rie.dao;

import org.springframework.jdbc.core.simple.SimpleJdbcDaoSupport;

/**
 * DetalleReservaDaoImpl.java es la implementacion de DetalleReservaDao.java
 * @author grupo 06 - upc_dew 2010
 */
public class DetalleReservaDaoImpl extends SimpleJdbcDaoSupport implements DetalleReservaDao{

    //protected final Log logger = LogFactory.getLog(getClass());

    /** obtiene ultimo codigo de detalleReserva registrado */
    public int getUltimoIdDetalleReserva() {
        logger.info("Obteniendo ultimo UltimoIdDetalleReserva!");
        int ultimoIdDetalleReserva = getSimpleJdbcTemplate().queryForInt(
            "select distinct idDetalleReserva from DetalleReservas where idDetalleReserva = (select max(idDetalleReserva) from DetalleReservas)");
        return ultimoIdDetalleReserva;
    }
}
